<%@ page language="java" import="java.util.*,com.ncp.model.entity.registerlogin.UserBasicBean" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String userID = (String)session.getAttribute("userID");
String url = (String)request.getAttribute("url");

UserBasicBean ubb = (UserBasicBean)request.getAttribute("ubb");

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'AddMyimg.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
   <link href="css/common.css" type="text/css" rel="stylesheet" />

  </head>
  <script text="text/JavaScript">
  
function  abc() {
 if(document.form2.img.value=="")
	{
	  window.confirm("请选择你要更换的图片？"); 	
	 document.form2.mm.focus();
	  return false;
	 }
 }
 </script>
  <body style="min-height:600px;">
  <div id="allpage" style="min-height:300px;">
    <jsp:include flush="true" page="../index/head.jsp"></jsp:include>
  <div id="Login" style="text-align:center; width:600px; margin:0 auto;">
   <br/>
 <p style="font-size:18px; color:#444; line-height:58px; border-bottom:1px solid #ccc; margin-bottom:20px;">头像更改</p>
 <form name="form2" action="uploadMyImgServlet?UserID=<%=userID%>"  method="post" enctype="multipart/form-data" name="Myform">
     <input type="file" name="img" style="border:1px solid #CCC;" value="选择你要更换的图片" />
     <input type="hidden" name="mm">
     <%if(url==null){%>
     <input type="submit" onclick="return abc();" value="确定" style="  border: 2px solid #CCCCCC; cursor: pointer;" />
     <%} %>
 </form>
 <br/>
  <br/>
   <br/>
 <%

 if(url!=null){

	 String imgname = (String)request.getAttribute("imgname");
	 %>
	 
	 <form action="InsertMyImgServlet?UserID=<%=ubb.getUserID()%>&imgname=<%=imgname %>" method="post" enctype="multipart/form-data" name="Myform">
     <img src="<%=url%>" style="width:200px; height:230px;" />
     <br/>
     <br/>
     <br/>
     <input type="submit"  value="确定" style="  border: 2px solid #CCCCCC; cursor: pointer;" />
     <a href="DelImgInTomcat?UserID=<%=ubb.getUserID()%>&imgname=<%=imgname %>" style="  border: 2px solid #CCCCCC; cursor: pointer;" ><img src="/NCP/images/register/44.png" />返回</a>
     </form>
	 <%
 }
 %>
   <div style="clear:both; height:40px;"></div>
	<div id="slice">
	</div>
	
	<p id="footer">地址：山东省淄博市张店区创业园&emsp;&emsp;电话：0533-545645634/0533-64533232&emsp;&emsp;传真：0533-545645634</p>
	
</div>
 </body>
 
</html>
